﻿/*
* @author Mikko Miettinen
*/
using UnityEngine;
using System.Collections;

public class postScores : MonoBehaviour {

	public HSController controller;
	bool shareNbr =true; //for controlling times data will be send to score db
	
    // Use this for initialization
    void Start() {
        controller = GetComponent<HSController>();
		postThem();
    }
	
	
	
	// Update is called once per frame
	void Update () {
	
	}
	
	public void postThem()
    {
        if (shareNbr == true)
        {
//            print("sendii");
            shareNbr = false;
			//StartCoroutine(controller.PostScores("999","Matti","esko", 666, "spaceship"));
			//lähettää tarvittavan datan hsControllerille pisteiden kantaan laittamista varten serveri puolella
            StartCoroutine(controller.PostScores(GM.userId,GM.first_name, GM.last_name, GM.LastScore, GM.LastGame));
        }
    }
}
